<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ include file="index.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="favicon.ico">
<link rel="Shortcut Icon" href="favicon.ico" />

<title>主页</title>
<meta name="keywords" content="耶回收">
<meta name="description" content="耶回收">

</head>
<body>
<!--_表格--开始-->
<section class="Hui-article-box" style="overflow: auto"> 
		<nav class="breadcrumb">
			<i class="Hui-iconfont">&#xe67f;</i> 
			首页		<span class="c-gray en">&gt;</span> 
			轮播管理     <span class="c-gray en">&gt;</span>
			轮播信息管理 
			<a class="btn btn-success radius r" style="line-height: 1.6em; margin-top: 3px" href="javascript:location.replace('')"title="刷新">
				<i class="Hui-iconfont">&#xe68f;</i>
			</a> 
		</nav>
	<div class="cl pd-5 bg-1 bk-gray mt-20">
		<span class="l">
			<a href="goAddLunBo" class="btn btn-primary radius">
				<i class="Hui-iconfont">&#xe600;</i>
				<strong>添加</strong>
			</a>
		</span> 
		<span class="r">共有数据：<strong>${lb.total}</strong>条 </span>
	</div>
	<table class="table table-border table-bordered table-bg">
		<thead>
			<tr>
				<th scope="col" colspan="7"><strong>轮播图信息列表</strong></th>
			</tr>
			<tr class="text-c">
				<th width="50">ID</th>
				<th width="100">图片名称</th>
				<th width="100">图片</th>
				<th width="100">图片链接地址</th>
				<th width="100">录入时间</th>
				<th width="100">轮播图归属</th>
				<th width="100">操作</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${lb.list }" var="list">
				<tr class="text-c">
					<td>${list.lbid }</td>
					<td>${list.lbname }</td>
					<td><img height="50px" width="50px" src="${list.lbimage }"></td>
					<td>${list.lblink }</td>
					<td><fmt:formatDate value="${list.lbcreated}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
					<c:if test="${list.lbpagename==1}">
						<td>耶回收主页</td>	
					</c:if>
					<c:if test="${list.lbpagename==2}">
						<td>耶优品</td>	
					</c:if>	
					<c:if test="${list.lbpagename==3}">
						<td>低价租赁</td>	
					</c:if>	
					<c:if test="${list.lbpagename==4}">
						<td>商品竞价</td>
					</c:if>	
					<td class="td-manage">
						<a title="编辑" href="toupdate?lbid=${list.lbid}" class="ml-5" style="text-decoration: none">
							<i class="Hui-iconfont">&#xe6df;</i>
						</a>
						<a title="删除" href="javascript:;" onclick="LunBo_del(${list.lbid })" class="ml-5" style="text-decoration: none">
							<i class="Hui-iconfont">&#xe6e2;</i>
						</a>
					</td>
				</tr>
			</c:forEach>
		</tbody>
		<thead>
			<th colspan="12"><p>当前第[${lb.pageNum}]页     共${lb.pages}页</p>
        		<a href="content-6_2?pageNum=1" >首页</a>
        			<c:if test="${lb.pageNum < lb.pages}">
        				<a href="content-6_2?pageNum=${lb.nextPage}">下一页</a>
        			</c:if>
        			<c:if test="${lb.pageNum >= lb.pages}">
						<a class="right">下一页</a>
					</c:if>
					<c:if test="${lb.pageNum > 1 }">
       					<a href="content-6_2?pageNum=${lb.prePage}">上一页</a>
       				</c:if>
       				<c:if test="${lb.pageNum <= 1 }">
						<a class="right">上一页</a>
					</c:if>
        		<a href="content-6_2?pageNum=${lb.pages}">尾页</a>
        	</th>
		</thead>
	</table>
	</div>
</section>
</body>

<script type="text/javascript">
	/*商品-删除*/
    function LunBo_del(lbid){
        layer.confirm('确认要删除吗？',{ btn: ["确定","取消"] },function(index){
            $.ajax({
                type: 'POST',
                url: 'deleteLunBo',
                data:{"lbid":lbid},
                dataType: 'json',
                success: function(val){
                	layer.close(index);
                	if(val==1){
                		alert("删除成功!");
                	};
                	if(val==2){
                		alert("删除失败！");
                	};
                	
                	window.location.href = window.location.href;                	
                },
                error:function(data) {
                    console.log(data.msg);
                },
            });
        });
    }	
</script>
</html>